﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WatiN.Core;

namespace WatiN.Sharepoint.Pages
{
    public static class Navigator
    {
        public static TPage Go<TPage>(Browser browser, string pageUrl) where TPage : BaseSPPage, new()
        {
            return Go<TPage>(browser, pageUrl, null);
        }

        public static TPage Go<TPage>(Browser browser, string pageUrl, Dictionary<string, string> parameters) where TPage : BaseSPPage, new()
        {
            BaseSPPage page = browser.Page<TPage>();
            page.GoTo(browser, pageUrl, parameters);
            return page as TPage;
        } 
    }
}
